<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人中心 - 我的账户</title>
    <!-- 引入Tailwind CSS -->
    <script src="https://cdn.tailwindcss.com"></script>
    <!-- 引入Font Awesome -->
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    
    <!-- 配置Tailwind自定义主题 -->
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#4F46E5',
                        secondary: '#10B981',
                        accent: '#F59E0B',
                        dark: '#1F2937',
                        light: '#F9FAFB'
                    },
                    fontFamily: {
                        inter: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    
    <!-- 自定义工具类 -->
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .card-shadow {
                box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            }
            .transition-smooth {
                transition: all 0.3s ease;
            }
        }
    </style>
    
    <style>
        /* 基础动画 */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .animate-fade-in {
            animation: fadeIn 0.5s ease forwards;
        }
        
        /* 平滑滚动 */
        html {
            scroll-behavior: smooth;
        }
        
        /* 表单元素聚焦效果 */
        input:focus, textarea:focus, select:focus {
            outline: none;
            box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
        }
        
        /* 自定义开关样式 */
        .toggle-checkbox:checked {
            right: 0;
            border-color: #4F46E5;
        }
        
        .toggle-checkbox:checked + .toggle-label {
            background-color: #4F46E5;
        }
    </style>
</head>

<body class="font-inter bg-gray-50 text-dark">
    <!-- 顶部导航栏 -->
    <header class="bg-white shadow-sm sticky top-0 z-50">
        <div class="container mx-auto px-4 md:px-6">
            <div class="flex justify-between items-center py-4">
                <!-- Logo和标题 -->
                <div class="flex items-center space-x-3">
                    <div class="w-10 h-10 rounded-lg bg-primary flex items-center justify-center">
                        <i class="fa fa-user-circle text-white text-xl"></i>
                    </div>
                    <h1 class="text-xl font-bold text-dark">个人中心</h1>
                </div>
                
                <!-- 右侧导航 -->
                <div class="flex items-center space-x-6">
                    <a href="#" class="text-gray-600 hover:text-primary transition-smooth">
                        <i class="fa fa-bell-o text-xl"></i>
                    </a>
                    <a href="#" class="text-gray-600 hover:text-primary transition-smooth">
                        <i class="fa fa-cog text-xl"></i>
                    </a>
                    <div class="relative">
                        <button id="userMenuBtn" class="flex items-center space-x-2 focus:outline-none">
                            <img src="https://picsum.photos/id/64/100/100" alt="用户头像" class="w-8 h-8 rounded-full object-cover border-2 border-primary">
                            <span class="hidden md:inline font-medium">张明</span>
                            <i class="fa fa-angle-down text-gray-500"></i>
                        </button>
                        <!-- 用户下拉菜单 -->
                        <div id="userMenu" class="absolute right-0 mt-2 w-48 bg-white rounded-lg shadow-lg py-2 hidden z-10">
                            <a href="#" class="block px-4 py-2 text-gray-700 hover:bg-gray-100 transition-smooth">
                                <i class="fa fa-user-o mr-2"></i>个人资料
                            </a>
                            <a href="#" class="block px-4 py-2 text-gray-700 hover:bg-gray-100 transition-smooth">
                                <i class="fa fa-cog mr-2"></i>账户设置
                            </a>
                            <div class="border-t border-gray-100 my-1"></div>
                            <a href="#" class="block px-4 py-2 text-red-600 hover:bg-gray-100 transition-smooth">
                                <i class="fa fa-sign-out mr-2"></i>退出登录
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </header>

    <main class="container mx-auto px-4 md:px-6 py-8">
        <div class="flex flex-col lg:flex-row gap-8">
            <!-- 左侧导航菜单 -->
            <aside class="lg:w-1/5">
                <div class="bg-white rounded-xl p-5 card-shadow sticky top-24">
                    <nav class="space-y-1">
                        <a href="#basic-info" class="flex items-center px-4 py-3 rounded-lg bg-primary/10 text-primary font-medium">
                            <i class="fa fa-id-card-o w-5 text-center mr-3"></i>
                            <span>基本信息</span>
                        </a>
                        <a href="#password" class="flex items-center px-4 py-3 rounded-lg text-gray-700 hover:bg-gray-100 transition-smooth">
                            <i class="fa fa-lock w-5 text-center mr-3"></i>
                            <span>密码修改</span>
                        </a>
                        <a href="#resume" class="flex items-center px-4 py-3 rounded-lg text-gray-700 hover:bg-gray-100 transition-smooth">
                            <i class="fa fa-file-pdf-o w-5 text-center mr-3"></i>
                            <span>个人简历</span>
                        </a>
                        <a href="#teacher-info" class="flex items-center px-4 py-3 rounded-lg text-gray-700 hover:bg-gray-100 transition-smooth">
                            <i class="fa fa-graduation-cap w-5 text-center mr-3"></i>
                            <span>教师信息</span>
                            <span class="ml-auto bg-accent/10 text-accent text-xs px-2 py-0.5 rounded-full">专属</span>
                        </a>
                        <a href="#privacy" class="flex items-center px-4 py-3 rounded-lg text-gray-700 hover:bg-gray-100 transition-smooth">
                            <i class="fa fa-eye-slash w-5 text-center mr-3"></i>
                            <span>隐私设置</span>
                        </a>
                    </nav>
                    
                    <div class="mt-8 pt-6 border-t border-gray-100">
                        <h3 class="font-medium text-gray-900 mb-4">账户状态</h3>
                        <div class="bg-green-50 border border-green-200 rounded-lg p-4 flex items-start">
                            <i class="fa fa-check-circle text-green-500 mt-0.5 mr-3"></i>
                            <div>
                                <p class="text-sm font-medium text-green-800">账户已认证</p>
                                <p class="text-xs text-green-700 mt-1">您的身份信息已通过审核</p>
                            </div>
                        </div>
                    </div>
                </div>
            </aside>
            
            <!-- 右侧内容区域 -->
            <div class="lg:w-4/5 space-y-8">
                <!-- 基本信息部分 -->
                <section id="basic-info" class="bg-white rounded-xl p-6 md:p-8 card-shadow animate-fade-in">
                    <div class="flex flex-col md:flex-row md:items-center justify-between mb-8">
                        <div>
                            <h2 class="text-2xl font-bold">基本信息</h2>
                            <p class="text-gray-500 mt-1">查看和编辑您的个人基本信息</p>
                        </div>
                        <button id="editBasicInfoBtn" class="mt-4 md:mt-0 text-primary hover:text-primary/80 font-medium flex items-center transition-smooth">
                            <i class="fa fa-pencil mr-2"></i> 编辑信息
                        </button>
                    </div>
                    
                    <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
                        <!-- 头像区域 -->
                        <div class="md:col-span-1 flex flex-col items-center">
                            <div class="relative mb-4">
                                <img id="avatarPreview" src="https://picsum.photos/id/64/200/200" alt="用户头像" class="w-40 h-40 rounded-full object-cover border-4 border-gray-100">
                                <div id="avatarEditBtn" class="hidden absolute bottom-0 right-0 w-10 h-10 bg-primary rounded-full flex items-center justify-center text-white cursor-pointer hover:bg-primary/90 transition-smooth">
                                    <i class="fa fa-camera"></i>
                                </div>
                                <input type="file" id="avatarUpload" accept="image/*" class="hidden">
                            </div>
                            <p class="text-sm text-gray-500 text-center">支持JPG、PNG格式，建议尺寸400×400px</p>
                        </div>
                        
                        <!-- 个人信息表单 -->
                        <div class="md:col-span-2 space-y-6">
                            <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">姓名</label>
                                    <input type="text" id="fullname" value="张明" class="w-full px-4 py-2 border border-gray-300 rounded-lg">
                                    <p class="text-xs text-gray-500 mt-1">姓名可以修改</p>
                                </div>
                                
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">性别</label>
                                    <select id="gender" class="w-full px-4 py-2 border border-gray-300 rounded-lg bg-gray-50 cursor-not-allowed" disabled>
                                        <option selected>男</option>
                                        <option>女</option>
                                    </select>
                                </div>
                                
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">联系电话</label>
                                    <input type="tel" id="phone" value="138****5678" class="w-full px-4 py-2 border border-gray-300 rounded-lg bg-gray-50 cursor-not-allowed" disabled>
                                </div>
                                
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">电子邮箱</label>
                                    <input type="email" value="zhangming@example.com" class="w-full px-4 py-2 border border-gray-300 rounded-lg bg-gray-50 cursor-not-allowed" disabled>
                                    <p class="text-xs text-gray-500 mt-1">用于接收重要通知</p>
                                </div>
                                
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">所属院系</label>
                                    <input type="text" value="计算机科学与技术学院" class="w-full px-4 py-2 border border-gray-300 rounded-lg bg-gray-50 cursor-not-allowed" disabled>
                                </div>
                                
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">身份类型</label>
                                    <select class="w-full px-4 py-2 border border-gray-300 rounded-lg bg-gray-50 cursor-not-allowed" disabled>
                                        <option selected>教师</option>
                                        <option>学生</option>
                                        <option>管理员</option>
                                    </select>
                                </div>
                            </div>
                            
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-1">个人简介</label>
                                <textarea id="bio" rows="4" class="w-full px-4 py-2 border border-gray-300 rounded-lg bg-gray-50 cursor-not-allowed resize-none" disabled>计算机科学与技术学院副教授，主要研究方向为人工智能、机器学习与数据挖掘。拥有10年教学经验，发表学术论文20余篇。</textarea>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 编辑模式下的按钮组 -->
                    <div id="basicInfoActions" class="hidden mt-8 flex justify-end space-x-4">
                        <button id="cancelEditBtn" class="px-6 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-smooth">
                            取消
                        </button>
                        <button id="saveBasicInfoBtn" class="px-6 py-2 bg-primary text-white rounded-lg hover:bg-primary/90 transition-smooth">
                            保存修改
                        </button>
                    </div>
                </section>
                
                <!-- 密码修改部分 -->
                <section id="password" class="bg-white rounded-xl p-6 md:p-8 card-shadow animate-fade-in" style="animation-delay: 0.1s;">
                    <div class="mb-8">
                        <h2 class="text-2xl font-bold">密码修改</h2>
                        <p class="text-gray-500 mt-1">修改您的账户密码，需验证原密码和邮箱</p>
                    </div>
                    
                    <form id="passwordForm" class="max-w-2xl">
                        <div class="space-y-6">
                            <div>
                                <label for="currentPassword" class="block text-sm font-medium text-gray-700 mb-1">原密码</label>
                                <input type="password" id="currentPassword" class="w-full px-4 py-2 border border-gray-300 rounded-lg" placeholder="请输入原密码">
                            </div>
                            
                            <div>
                                <label for="newPassword" class="block text-sm font-medium text-gray-700 mb-1">新密码</label>
                                <input type="password" id="newPassword" class="w-full px-4 py-2 border border-gray-300 rounded-lg" placeholder="请输入新密码">
                                <p class="text-xs text-gray-500 mt-1">密码长度至少8位，包含字母和数字</p>
                            </div>
                            
                            <div>
                                <label for="confirmPassword" class="block text-sm font-medium text-gray-700 mb-1">确认新密码</label>
                                <input type="password" id="confirmPassword" class="w-full px-4 py-2 border border-gray-300 rounded-lg" placeholder="请再次输入新密码">
                            </div>
                            
                            <div class="pt-4 border-t border-gray-100">
                                <label class="block text-sm font-medium text-gray-700 mb-3">邮箱验证</label>
                                <div class="flex space-x-3">
                                    <input type="text" id="emailCode" class="flex-1 px-4 py-2 border border-gray-300 rounded-lg" placeholder="请输入验证码">
                                    <button type="button" id="sendCodeBtn" class="px-5 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-smooth whitespace-nowrap">
                                        获取验证码
                                    </button>
                                </div>
                                <p class="text-xs text-gray-500 mt-1">验证码将发送至邮箱：zhangming@example.com</p>
                            </div>
                        </div>
                        
                        <div class="mt-8">
                            <button type="submit" class="px-6 py-2 bg-primary text-white rounded-lg hover:bg-primary/90 transition-smooth">
                                确认修改
                            </button>
                        </div>
                    </form>
                </section>
                
                <!-- 个人简历部分 -->
                <section id="resume" class="bg-white rounded-xl p-6 md:p-8 card-shadow animate-fade-in" style="animation-delay: 0.2s;">
                    <div class="flex flex-col md:flex-row md:items-center justify-between mb-8">
                        <div>
                            <h2 class="text-2xl font-bold">个人简历</h2>
                            <p class="text-gray-500 mt-1">上传或更新您的个人简历（PDF格式）</p>
                        </div>
                        <label for="resumeUpload" class="mt-4 md:mt-0 px-5 py-2 bg-primary text-white rounded-lg hover:bg-primary/90 transition-smooth cursor-pointer flex items-center">
                            <i class="fa fa-upload mr-2"></i> 上传简历
                        </label>
                        <input type="file" id="resumeUpload" accept=".pdf" class="hidden">
                    </div>
                    
                    <!-- 当前简历 -->
                    <div class="border border-gray-200 rounded-lg p-5 bg-gray-50 flex items-center">
                        <div class="w-12 h-16 bg-red-100 rounded flex items-center justify-center mr-4 flex-shrink-0">
                            <i class="fa fa-file-pdf-o text-red-500 text-2xl"></i>
                        </div>
                        <div class="flex-1 min-w-0">
                            <h3 class="font-medium text-gray-900 truncate">张明_个人简历.pdf</h3>
                            <div class="flex items-center mt-1 text-sm text-gray-500">
                                <span class="flex items-center mr-4">
                                    <i class="fa fa-calendar-o mr-1"></i> 更新于2023-05-18
                                </span>
                                <span class="flex items-center">
                                    <i class="fa fa-file-o mr-1"></i> 1.2 MB
                                </span>
                            </div>
                        </div>
                        <div class="flex items-center ml-4">
                            <a href="#" class="text-primary hover:text-primary/80 mr-4 transition-smooth" title="下载">
                                <i class="fa fa-download text-lg"></i>
                            </a>
                            <button id="replaceResumeBtn" class="text-gray-600 hover:text-gray-900 mr-4 transition-smooth" title="替换">
                                <i class="fa fa-refresh text-lg"></i>
                            </button>
                            <button id="deleteResumeBtn" class="text-red-500 hover:text-red-700 transition-smooth" title="删除">
                                <i class="fa fa-trash-o text-lg"></i>
                            </button>
                        </div>
                    </div>
                    
                    <!-- 上传提示 -->
                    <div class="mt-4 text-sm text-gray-500">
                        <p><i class="fa fa-info-circle text-primary mr-1"></i> 支持上传PDF格式文件，最大不超过5MB</p>
                    </div>
                </section>
                
                <!-- 教师信息部分 -->
                <section id="teacher-info" class="bg-white rounded-xl p-6 md:p-8 card-shadow animate-fade-in" style="animation-delay: 0.3s;">
                    <div class="flex flex-col md:flex-row md:items-center justify-between mb-8">
                        <div>
                            <h2 class="text-2xl font-bold">教师信息</h2>
                            <p class="text-gray-500 mt-1">编辑您的职称、研究方向和授课领域</p>
                            <span class="inline-block mt-2 px-2.5 py-0.5 text-xs font-medium bg-accent/10 text-accent rounded-full">教师专属</span>
                        </div>
                        <button id="editTeacherInfoBtn" class="mt-4 md:mt-0 text-primary hover:text-primary/80 font-medium flex items-center transition-smooth">
                            <i class="fa fa-pencil mr-2"></i> 编辑信息
                        </button>
                    </div>
                    
                    <div class="space-y-6">
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-1">职称</label>
                                <input type="text" id="title" value="副教授" class="w-full px-4 py-2 border border-gray-300 rounded-lg bg-gray-50 cursor-not-allowed" disabled>
                            </div>
                            
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-1">入职时间</label>
                                <input type="date" id="hireDate" value="2013-09-01" class="w-full px-4 py-2 border border-gray-300 rounded-lg bg-gray-50 cursor-not-allowed" disabled>
                            </div>
                        </div>
                        
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-1">研究方向</label>
                            <input type="text" id="researchArea" value="人工智能、机器学习、数据挖掘" class="w-full px-4 py-2 border border-gray-300 rounded-lg bg-gray-50 cursor-not-allowed" disabled>
                            <p class="text-xs text-gray-500 mt-1">多个研究方向请用逗号分隔</p>
                        </div>
                        
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-1">授课领域</label>
                            <textarea id="teachingArea" rows="3" class="w-full px-4 py-2 border border-gray-300 rounded-lg bg-gray-50 cursor-not-allowed resize-none" disabled>数据结构与算法、人工智能导论、机器学习、深度学习、大数据分析与应用</textarea>
                            <p class="text-xs text-gray-500 mt-1">每行填写一个授课领域</p>
                        </div>
                        
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-1">学术成果</label>
                            <textarea id="academicAchievements" rows="4" class="w-full px-4 py-2 border border-gray-300 rounded-lg bg-gray-50 cursor-not-allowed resize-none" disabled>发表学术论文20余篇，其中SCI收录10篇，EI收录8篇；主持国家级科研项目2项，省部级科研项目3项；获得省级教学成果奖1项。</textarea>
                        </div>
                    </div>
                    
                    <!-- 编辑模式下的按钮组 -->
                    <div id="teacherInfoActions" class="hidden mt-8 flex justify-end space-x-4">
                        <button id="cancelTeacherEditBtn" class="px-6 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-smooth">
                            取消
                        </button>
                        <button id="saveTeacherInfoBtn" class="px-6 py-2 bg-primary text-white rounded-lg hover:bg-primary/90 transition-smooth">
                            保存修改
                        </button>
                    </div>
                </section>
                
                <!-- 隐私设置部分 -->
                <section id="privacy" class="bg-white rounded-xl p-6 md:p-8 card-shadow animate-fade-in" style="animation-delay: 0.4s;">
                    <div class="mb-8">
                        <h2 class="text-2xl font-bold">隐私设置</h2>
                        <p class="text-gray-500 mt-1">控制您的个人信息对他人的可见性</p>
                    </div>
                    
                    <div class="space-y-6">
                        <div class="border-b border-gray-100 pb-6">
                            <h3 class="text-lg font-medium mb-4">基本信息可见性</h3>
                            
                            <div class="space-y-4">
                                <div class="flex items-center justify-between">
                                    <div>
                                        <p class="font-medium">姓名</p>
                                        <p class="text-sm text-gray-500 mt-0.5">您的真实姓名</p>
                                    </div>
                                    <select class="px-3 py-1.5 border border-gray-300 rounded-lg text-sm">
                                        <option selected>所有人可见</option>
                                        <option>仅校内可见</option>
                                        <option>仅好友可见</option>
                                    </select>
                                </div>
                                
                                <div class="flex items-center justify-between">
                                    <div>
                                        <p class="font-medium">头像</p>
                                        <p class="text-sm text-gray-500 mt-0.5">您的个人头像</p>
                                    </div>
                                    <select class="px-3 py-1.5 border border-gray-300 rounded-lg text-sm">
                                        <option selected>所有人可见</option>
                                        <option>仅校内可见</option>
                                        <option>仅好友可见</option>
                                    </select>
                                </div>
                                
                                <div class="flex items-center justify-between">
                                    <div>
                                        <p class="font-medium">所属院系</p>
                                        <p class="text-sm text-gray-500 mt-0.5">您所在的院系信息</p>
                                    </div>
                                    <select class="px-3 py-1.5 border border-gray-300 rounded-lg text-sm">
                                        <option selected>所有人可见</option>
                                        <option>仅校内可见</option>
                                        <option>仅好友可见</option>
                                        <option>完全隐藏</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        
                        <div class="border-b border-gray-100 pb-6">
                            <h3 class="text-lg font-medium mb-4">联系方式可见性</h3>
                            
                            <div class="space-y-4">
                                <div class="flex items-center justify-between">
                                    <div>
                                        <p class="font-medium">联系电话</p>
                                        <p class="text-sm text-gray-500 mt-0.5">您的手机号码</p>
                                    </div>
                                    <select class="px-3 py-1.5 border border-gray-300 rounded-lg text-sm">
                                        <option>所有人可见</option>
                                        <option>仅校内可见</option>
                                        <option selected>仅好友可见</option>
                                        <option>完全隐藏</option>
                                    </select>
                                </div>
                                
                                <div class="flex items-center justify-between">
                                    <div>
                                        <p class="font-medium">电子邮箱</p>
                                        <p class="text-sm text-gray-500 mt-0.5">您的邮箱地址</p>
                                    </div>
                                    <select class="px-3 py-1.5 border border-gray-300 rounded-lg text-sm">
                                        <option>所有人可见</option>
                                        <option selected>仅校内可见</option>
                                        <option>仅好友可见</option>
                                        <option>完全隐藏</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        
                        <div>
                            <h3 class="text-lg font-medium mb-4">其他设置</h3>
                            
                            <div class="space-y-4">
                                <div class="flex items-center justify-between">
                                    <div>
                                        <p class="font-medium">允许他人查看我的简历</p>
                                        <p class="text-sm text-gray-500 mt-0.5">控制是否允许其他用户查看您上传的简历</p>
                                    </div>
                                    <div class="relative inline-block w-10 align-middle select-none">
                                        <input type="checkbox" id="allowViewResume" checked class="toggle-checkbox absolute block w-5 h-5 rounded-full bg-white border-4 appearance-none cursor-pointer"/>
                                        <label for="allowViewResume" class="toggle-label block overflow-hidden h-5 rounded-full bg-gray-300 cursor-pointer"></label>
                                    </div>
                                </div>
                                
                                <div class="flex items-center justify-between">
                                    <div>
                                        <p class="font-medium">允许收到学术交流邀请</p>
                                        <p class="text-sm text-gray-500 mt-0.5">是否接收其他用户发来的学术交流邀请</p>
                                    </div>
                                    <div class="relative inline-block w-10 align-middle select-none">
                                        <input type="checkbox" id="allowAcademicInvites" checked class="toggle-checkbox absolute block w-5 h-5 rounded-full bg-white border-4 appearance-none cursor-pointer"/>
                                        <label for="allowAcademicInvites" class="toggle-label block overflow-hidden h-5 rounded-full bg-gray-300 cursor-pointer"></label>
                                    </div>
                                </div>
                                
                                <div class="flex items-center justify-between">
                                    <div>
                                        <p class="font-medium">允许收到合作请求</p>
                                        <p class="text-sm text-gray-500 mt-0.5">是否接收其他用户发来的合作请求</p>
                                    </div>
                                    <div class="relative inline-block w-10 align-middle select-none">
                                        <input type="checkbox" id="allowCollaborationRequests" checked class="toggle-checkbox absolute block w-5 h-5 rounded-full bg-white border-4 appearance-none cursor-pointer"/>
                                        <label for="allowCollaborationRequests" class="toggle-label block overflow-hidden h-5 rounded-full bg-gray-300 cursor-pointer"></label>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="mt-8 flex justify-end">
                        <button id="savePrivacySettingsBtn" class="px-6 py-2 bg-primary text-white rounded-lg hover:bg-primary/90 transition-smooth">
                            保存设置
                        </button>
                    </div>
                </section>
            </div>
        </div>
    </main>
    
    <!-- 页脚 -->
    <footer class="bg-white border-t border-gray-200 mt-12">
        <div class="container mx-auto px-4 md:px-6 py-8">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <p class="text-gray-500 text-sm">© 2023 学校信息管理系统. 保留所有权利.</p>
                <div class="flex space-x-6 mt-4 md:mt-0">
                    <a href="#" class="text-gray-500 hover:text-primary text-sm transition-smooth">使用帮助</a>
                    <a href="#" class="text-gray-500 hover:text-primary text-sm transition-smooth">隐私政策</a>
                    <a href="#" class="text-gray-500 hover:text-primary text-sm transition-smooth">联系我们</a>
                </div>
            </div>
        </div>
    </footer>
    
    <!-- 成功提示弹窗 -->
    <div id="successToast" class="fixed bottom-6 right-6 bg-green-500 text-white px-6 py-3 rounded-lg shadow-lg transform translate-y-20 opacity-0 transition-all duration-300 flex items-center z-50">
        <i class="fa fa-check-circle mr-2"></i>
        <span id="toastMessage">操作成功</span>
    </div>

    <!-- JavaScript -->
    <script>
        // 用户菜单切换
        const userMenuBtn = document.getElementById('userMenuBtn');
        const userMenu = document.getElementById('userMenu');
        
        userMenuBtn.addEventListener('click', function() {
            userMenu.classList.toggle('hidden');
        });
        
        // 点击其他区域关闭用户菜单
        document.addEventListener('click', function(event) {
            if (!userMenuBtn.contains(event.target) && !userMenu.contains(event.target)) {
                userMenu.classList.add('hidden');
            }
        });
        
        // 基本信息编辑功能
        const editBasicInfoBtn = document.getElementById('editBasicInfoBtn');
        const cancelEditBtn = document.getElementById('cancelEditBtn');
        const saveBasicInfoBtn = document.getElementById('saveBasicInfoBtn');
        const basicInfoActions = document.getElementById('basicInfoActions');
        const avatarEditBtn = document.getElementById('avatarEditBtn');
        const avatarUpload = document.getElementById('avatarUpload');
        const avatarPreview = document.getElementById('avatarPreview');
        
        // 可编辑的字段（已包含姓名）
        const editableFields = ['fullname', 'phone', 'bio'];
        
        // 编辑按钮点击事件
        editBasicInfoBtn.addEventListener('click', function() {
            // 切换到编辑模式
            editableFields.forEach(fieldId => {
                const field = document.getElementById(fieldId);
                field.classList.remove('bg-gray-50', 'cursor-not-allowed');
                field.removeAttribute('disabled');
            });
            
            // 显示编辑头像按钮和操作按钮
            avatarEditBtn.classList.remove('hidden');
            basicInfoActions.classList.remove('hidden');
            
            // 隐藏编辑按钮
            editBasicInfoBtn.classList.add('hidden');
        });
        
        // 取消编辑按钮点击事件
        cancelEditBtn.addEventListener('click', function() {
            // 切换到查看模式，姓名始终保持可编辑
            editableFields.filter(field => field !== 'fullname').forEach(fieldId => {
                const field = document.getElementById(fieldId);
                field.classList.add('bg-gray-50', 'cursor-not-allowed');
                field.setAttribute('disabled', 'true');
            });
            
            // 隐藏编辑头像按钮和操作按钮
            avatarEditBtn.classList.add('hidden');
            basicInfoActions.classList.add('hidden');
            
            // 显示编辑按钮
            editBasicInfoBtn.classList.remove('hidden');
        });
        
        // 保存基本信息按钮点击事件
        saveBasicInfoBtn.addEventListener('click', function() {
            // 更新顶部导航栏显示的姓名
            const newName = document.getElementById('fullname').value.trim();
            if (newName && newName !== '张明') {
                document.querySelector('#userMenuBtn span').textContent = newName;
            }
            
            // 模拟保存操作
            showToast('基本信息保存成功');
            
            // 切换到查看模式
            cancelEditBtn.click();
        });
        
        // 头像上传功能
        avatarEditBtn.addEventListener('click', function() {
            avatarUpload.click();
        });
        
        avatarUpload.addEventListener('change', function(e) {
            if (e.target.files && e.target.files[0]) {
                const reader = new FileReader();
                
                reader.onload = function(e) {
                    avatarPreview.src = e.target.result;
                    // 更新顶部导航栏的头像
                    document.querySelector('#userMenuBtn img').src = e.target.result;
                    showToast('头像上传成功');
                }
                
                reader.readAsDataURL(e.target.files[0]);
            }
        });
        
        // 教师信息编辑功能
        const editTeacherInfoBtn = document.getElementById('editTeacherInfoBtn');
        const cancelTeacherEditBtn = document.getElementById('cancelTeacherEditBtn');
        const saveTeacherInfoBtn = document.getElementById('saveTeacherInfoBtn');
        const teacherInfoActions = document.getElementById('teacherInfoActions');
        
        // 教师可编辑的字段
        const teacherEditableFields = ['title', 'hireDate', 'researchArea', 'teachingArea', 'academicAchievements'];
        
        // 编辑按钮点击事件
        editTeacherInfoBtn.addEventListener('click', function() {
            // 切换到编辑模式
            teacherEditableFields.forEach(fieldId => {
                const field = document.getElementById(fieldId);
                field.classList.remove('bg-gray-50', 'cursor-not-allowed');
                field.removeAttribute('disabled');
            });
            
            // 显示操作按钮
            teacherInfoActions.classList.remove('hidden');
            
            // 隐藏编辑按钮
            editTeacherInfoBtn.classList.add('hidden');
        });
        
        // 取消编辑按钮点击事件
        cancelTeacherEditBtn.addEventListener('click', function() {
            // 切换到查看模式
            teacherEditableFields.forEach(fieldId => {
                const field = document.getElementById(fieldId);
                field.classList.add('bg-gray-50', 'cursor-not-allowed');
                field.setAttribute('disabled', 'true');
            });
            
            // 隐藏操作按钮
            teacherInfoActions.classList.add('hidden');
            
            // 显示编辑按钮
            editTeacherInfoBtn.classList.remove('hidden');
        });
        
        // 保存教师信息按钮点击事件
        saveTeacherInfoBtn.addEventListener('click', function() {
            // 模拟保存操作
            showToast('教师信息保存成功');
            
            // 切换到查看模式
            cancelTeacherEditBtn.click();
        });
        
        // 简历上传功能
        const resumeUpload = document.getElementById('resumeUpload');
        const replaceResumeBtn = document.getElementById('replaceResumeBtn');
        const deleteResumeBtn = document.getElementById('deleteResumeBtn');
        
        replaceResumeBtn.addEventListener('click', function() {
            resumeUpload.click();
        });
        
        resumeUpload.addEventListener('change', function(e) {
            if (e.target.files && e.target.files[0]) {
                // 检查文件类型
                if (e.target.files[0].type !== 'application/pdf') {
                    alert('请上传PDF格式的文件');
                    return;
                }
                
                // 检查文件大小
                if (e.target.files[0].size > 5 * 1024 * 1024) {
                    alert('文件大小不能超过5MB');
                    return;
                }
                
                showToast('简历上传成功');
                // 这里可以添加实际上传逻辑
            }
        });
        
        deleteResumeBtn.addEventListener('click', function() {
            if (confirm('确定要删除当前简历吗？此操作不可恢复。')) {
                showToast('简历已删除');
                // 这里可以添加实际删除逻辑
            }
        });
        
        // 密码修改表单提交
        const passwordForm = document.getElementById('passwordForm');
        
        passwordForm.addEventListener('submit', function(e) {
            e.preventDefault();
            
            const currentPassword = document.getElementById('currentPassword').value;
            const newPassword = document.getElementById('newPassword').value;
            const confirmPassword = document.getElementById('confirmPassword').value;
            const emailCode = document.getElementById('emailCode').value;
            
            // 简单验证
            if (!currentPassword) {
                alert('请输入原密码');
                return;
            }
            
            if (newPassword.length < 8) {
                alert('新密码长度至少8位');
                return;
            }
            
            if (newPassword !== confirmPassword) {
                alert('两次输入的新密码不一致');
                return;
            }
            
            if (!emailCode) {
                alert('请输入验证码');
                return;
            }
            
            // 模拟提交成功
            showToast('密码修改成功');
            passwordForm.reset();
        });
        
        // 发送验证码
        const sendCodeBtn = document.getElementById('sendCodeBtn');
        let countdown = 0;
        
        sendCodeBtn.addEventListener('click', function() {
            if (countdown > 0) return;
            
            // 模拟发送验证码
            showToast('验证码已发送到您的邮箱');
            
            // 倒计时60秒
            countdown = 60;
            updateCountdown();
        });
        
        function updateCountdown() {
            if (countdown > 0) {
                sendCodeBtn.innerHTML = `${countdown}秒后重发`;
                sendCodeBtn.classList.add('bg-gray-300', 'cursor-not-allowed');
                sendCodeBtn.classList.remove('bg-gray-100', 'hover:bg-gray-200');
                countdown--;
                setTimeout(updateCountdown, 1000);
            } else {
                sendCodeBtn.innerHTML = '获取验证码';
                sendCodeBtn.classList.remove('bg-gray-300', 'cursor-not-allowed');
                sendCodeBtn.classList.add('bg-gray-100', 'hover:bg-gray-200');
            }
        }
        
        // 保存隐私设置
        const savePrivacySettingsBtn = document.getElementById('savePrivacySettingsBtn');
        
        savePrivacySettingsBtn.addEventListener('click', function() {
            showToast('隐私设置保存成功');
        });
        
        // 显示提示消息
        function showToast(message) {
            const toast = document.getElementById('successToast');
            const toastMessage = document.getElementById('toastMessage');
            
            toastMessage.textContent = message;
            toast.classList.remove('translate-y-20', 'opacity-0');
            toast.classList.add('translate-y-0', 'opacity-100');
            
            // 3秒后隐藏
            setTimeout(() => {
                toast.classList.add('translate-y-20', 'opacity-0');
                toast.classList.remove('translate-y-0', 'opacity-100');
            }, 3000);
        }
        
        // 页面加载完成后执行
        document.addEventListener('DOMContentLoaded', function() {
            // 平滑滚动处理
            document.querySelectorAll('a[href^="#"]').forEach(anchor => {
                anchor.addEventListener('click', function (e) {
                    e.preventDefault();
                    
                    const targetId = this.getAttribute('href');
                    const targetElement = document.querySelector(targetId);
                    
                    if (targetElement) {
                        window.scrollTo({
                            top: targetElement.offsetTop - 80,
                            behavior: 'smooth'
                        });
                    }
                });
            });
        });
    </script>
</body>
</html>
    